$(document).ready(function () {
    $(".sideMenu h3:not(.on)").next().slideToggle();

    $(".sideMenu h3").click(function () {
        if ($(this).hasClass("on")) {

        } else {
            $(".on").next().slideToggle();
            $(".on").removeClass("on");
            $(this).addClass("on");
            $(this).next().slideToggle();
        }
    });

    addCity();

});

const PROVINCES = [
    {code:'广东省', cities: ['广州市', '深圳市']},
    {code:'北京', cities: ['东城区', '西城区']}
];

function addCity() {
    let city = $("#temCity").val();
    let $province = $("#province");
    let $city = $("#city");
    $city.empty();
    let province = $province.val();
    let result = PROVINCES.filter(p => p.code === province)[0];
    result.cities.forEach(value => {
        let s = city === value ? "selected" : "";
        $city.append("<option value='"+value+ "'" + s +">" + value + "</option>");
    })
}

function uploadTeacherApplyPic(){
    $("#idCardPicForm").submit();
}